; unsigned int buscar(lista l, int n);

global buscar

%define ptr_l [ebp + 8]
%define n [ebp + 12]
%define off_dato 0
%define off_prox 4

section .text

buscar:
	push ebp
	mov ebp, esp
	push esi
	push edi
	push ebx
	
	mov esi, ptr_l
	mov ebx, n
	xor eax, eax
	
ciclo:
	inc eax
	mov ecx, [esi + off_dato]
	cmp ebx, ecx
	je fin
	mov esi, [esi + off_prox]
	jmp ciclo
	
fin:
	pop ebx
	pop edi
	pop esi
	pop ebp
	ret
